/**
 * Created with IntelliJ IDEA.
 * User: Инесса
 * Date: 07.10.13
 * Time: 20:23
 * To change this template use File | Settings | File Templates.
 */
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class PalindromeFinder {

    public static void main(String... args) {
        Scanner in = new Scanner(System.in);
        List<String> palindromes = palindromeSubstrings(in.nextLine());
        palindromesPrint(palindromes);
    }

    /**
     * Method for printing palindromes
     * @param palindromes
     */
    private static void palindromesPrint(List<String> palindromes) {
        for (String result : palindromes) {
            System.out.println(result);
        }
        System.out.println("Found " + palindromes.size() + " palindroms.");
    }

    /**
     * Method for selecting substrings
     * @param text
     * @return
     */
    private static List<String> palindromeSubstrings(String text) {
        List<String> palindroms = new ArrayList<String>();

        for (int i = 0; i < text.length() - 2; ++i) {
            for (int j = i + 2; j < text.length(); ++j) {
                if (isPalindrome(text.substring(i, j + 1))) {
                    palindroms.add(text.substring(i, j + 1));
                }
            }
        }

        return palindroms;
    }

    /**
     * Method for checking substring.
     * @param line
     * @return
     */
    private static boolean isPalindrome(String line) {
        for (int i = 0; i < line.length() / 2; ++i) {
            if (line.codePointAt(i) != line.codePointAt(line.length() - i - 1)) {
                return false;
            }
        }
        return true;
    }
}
